<?php

namespace App\Common\Util\ImitateAop\Attributes;

use App\Common\Util\ImitateAop\Aspects\TransactionAspect;
use JetBrains\PhpStorm\Pure;
use Sc\Util\ImitateAopProxy\Interfaces\ImitateAspectAttrInterface;
use Sc\Util\ImitateAopProxy\Interfaces\ImitateAspectInterface;

/**
 * 数据库事务切片注解
 *
 * Class Transaction
 */
#[\Attribute(\Attribute::TARGET_METHOD)]
class Transaction implements ImitateAspectAttrInterface
{
    /**
     * @param \ReflectionFunctionAbstract $reflectionFunctionAbstract
     *
     * @return ImitateAspectInterface
     */
    #[Pure] public function getImitateAspect(\ReflectionFunctionAbstract $reflectionFunctionAbstract): ImitateAspectInterface
    {
        return new TransactionAspect();
    }
}